package org.example.springboot.enumClass;

import lombok.Getter;

/**
 * 推荐类型枚举
 */
@Getter
public enum RecommendationType {
    USER_CF(1, "基于您的喜好"),
    ITEM_CF(2, "猜您喜欢的书"),
    CONTENT_BASED(3, "为您定制"),
    HOT(4, "热门推荐"),
    NEW(5, "新书推荐");
    
    private final Integer value;
    private final String desc;
    
    RecommendationType(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }
    
    public static String getDescByValue(Integer value) {
        for (RecommendationType type : RecommendationType.values()) {
            if (type.getValue().equals(value)) {
                return type.getDesc();
            }
        }
        return null;
    }
} 